package com.hxd.buybooksystem.bean

import cn.bmob.v3.BmobObject
import com.google.gson.Gson
import java.io.File

/**
 *  项目名：    BuyBookSystem
 *  包名：      com.hxd.buybooksystem.bean
 *  文件名:     BookInfo
 *  创建者:     HXD
 *  创建时间:   2019/5/29 19:30
 *  描述:       书籍信息实体类
 */

data class BookInfo(
//    val bookObjectId:String = "",
    val name: String = "",
    val desc: String = "",
    val author: String = "",
    var count: Int = 0,
    val price: String = "",
    val image: String? = null,
    val press: String = ""
) : BmobObject(){
    fun toJson():String{
        val gson = Gson()
        val bookInfo = BookInfo(name.trim(), desc.trim(), author.trim(), count, price.trim(), image!!.trim(), press.trim())
        return gson.toJson(bookInfo)
    }
}